package languageacquisition.ontology;

import jade.content.onto.*;
import jade.content.schema.*;

public class LanguageOntology extends Ontology implements Vocabulary{
	private static final long serialVersionUID = -6537554397948659172L;
	public static final String ONTOLOGY_NAME = "languageOntology";
	private static Ontology theInstance = new LanguageOntology();
	public static Ontology getInstance() {
		return theInstance;
		}
	public LanguageOntology(){
		
		super(ONTOLOGY_NAME, BasicOntology.getInstance(), new CFReflectiveIntrospector());
		try {
			add(new ConceptSchema(ENVOBJECT), EnvObject.class);
			add(new ConceptSchema(PROPERTY), Property.class);
			add(new ConceptSchema(STATE), State.class);
			add(new ConceptSchema(LANGUAGESYMBOL), LanguageSymbol.class);
			add(new PredicateSchema(HASSTATE), HasState.class);
			add(new PredicateSchema(DESCRIBES), Describes.class);
			
			//creating structure of schemas
			ConceptSchema cs = (ConceptSchema) getSchema(PROPERTY);
			cs.add(PROPERTY_ID, (PrimitiveSchema) getSchema(BasicOntology.INTEGER));
			cs = (ConceptSchema) getSchema(STATE);
			cs.add(STATE_PROPERTIES, (ConceptSchema) getSchema(PROPERTY),1,ObjectSchema.UNLIMITED);
			cs = (ConceptSchema) getSchema(LANGUAGESYMBOL);
			cs.add(LANGUAGESYMBOL_ID, (PrimitiveSchema) getSchema(BasicOntology.INTEGER));
			cs = (ConceptSchema) getSchema(ENVOBJECT);
			cs.add(OBJECT_ID, (ConceptSchema) getSchema(BasicOntology.AID));
			PredicateSchema ps = (PredicateSchema) getSchema(HASSTATE);
			ps.add(HASSTATE_OBJECT, (ConceptSchema) getSchema(ENVOBJECT));
			ps.add(HASSTATE_STATE, (ConceptSchema) getSchema(STATE));
			ps.add(HASSTATE_TIME, (PrimitiveSchema) getSchema(BasicOntology.INTEGER));
			
			ps = (PredicateSchema) getSchema(DESCRIBES);
			ps.add(DESCRIBES_OBJECT, (ConceptSchema) getSchema(ENVOBJECT));
			ps.add(DESCRIBES_SYMBOL, (ConceptSchema) getSchema(LANGUAGESYMBOL));
			ps.add(DESCRIBES_TIME, (PrimitiveSchema) getSchema(BasicOntology.INTEGER));
			
			
		}
		catch (OntologyException oe) {
			oe.printStackTrace();
			}
	}
	

}
